package com.fox.imagedb.gui.components;

import java.awt.FlowLayout;

import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTextField;

public class TextField extends JPanel {

	private static final long serialVersionUID = 1L;

	private JTextField textField;
	private JLabel label;

	public TextField(String labelName) {
		super(new FlowLayout());


		this.textField = new JTextField(30);
		this.label = new JLabel(labelName);
		this.label.setLabelFor(textField);

		add(label);
		add(textField);
		// this.setEditable(false);
		// this.setFocusable(false);
	}

	public JLabel getLabel() {
		return label;
	}

	public void setText(String text) {
		textField.setText(text);
	}

	public void addToPanel(JPanel panel) {
		panel.add(label);
		panel.add(textField, "wrap, span");
	}

}
